package com.linguochao.rabbitmq.comsumer;

import com.linguochao.rabbitmq.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author linguochao
 * @Description rabbitmq消费者
 * @Date 2020/7/15 18:09
 */
@Component
public class RabbitComsumer {

    @RabbitListener(queues = RabbitMQConfig.QUEUE_INFORM_SMS)
    public void sendMessage(Map msg){
        System.out.println("发送短信成功,用户:"+msg);
    }

    @RabbitListener(queues = RabbitMQConfig.QUEUE_DATA_MYSQL)
    public void addMysqlUser(String user){
        System.out.println("Mysql入库,用户:"+user);
    }

    @RabbitListener(queues = RabbitMQConfig.QUEUE_DATA_SOLR)
    public void addSolrUser(String user){
        System.out.println("Solr存储,用户:"+user);
    }

    @RabbitListener(queues = RabbitMQConfig.QUEUE_QQ)
    public void qq(String msg){
        System.out.println("QQ消息:"+msg);
    }

    @RabbitListener(queues = RabbitMQConfig.QUEUE_WX)
    public void wx(String msg){
        System.out.println("微信消息:"+msg);
    }

    @RabbitListener(queues = RabbitMQConfig.QUEUE_LOG)
    public void log(String msg){
        System.out.println("日志消息:"+msg);
    }
}
